<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8"/>
    <title>购买记录</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <meta name="renderer" content="webkit">
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <meta name="mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="format-detection" content="telephone=no,email=no,address=no"/>
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="../css/common.css"/>
    <link rel="stylesheet" href="../css/main.css"/>
    <link rel="stylesheet" href="../js/drop/dropload.css" />
</head>
<body>
    <article id="wrap">
        <ul class="list">
            <!--<li class="bw plr24 goods_item" onclick="location.href='user_details.html?id=4'">
                <a class="db">
                    <p class="flex_sb lh70 bdb">
                        <span class="col9">2018-06-06 12:12:32</span>
                        <cite class="color1">已完成</cite>
                    </p>
                    <div class="ptb30 flex_a bdb">
                        <div><img src="../img/test.png" class="goods_pic"></div>
                        <div class="flex1 ml20">
                            <p>清风纸巾</p>
                            <p class="flex_sb">
                                <span class="color2">￥2.00</span>
                                <cite class="col9">x1</cite>
                            </p>
                        </div>
                    </div>
                </a>
                <div class="flex_sb ptb20">
                    <span class="col9"></span>
                    <cite class="col9">合计:<i class="color3">￥10.00</i></cite>
                </div>
            </li>-->
        </ul>
    </article>
</body>
</html>
<script src="../js/jquery-1.8.3.min.js"></script>
<script src="../js/dlc.js"></script>
<script type="text/javascript" src="../js/drop/dropload.min.js"></script>
<script src="../js/Unix.js"></script>
<script>

  $(function(){
    var page = 0;
    var pagesize = 10;
    $('#wrap').dropload({
      scrollArea : window,
      domUp : {
        domClass   : 'dropload-up',
        domRefresh : '<div class="dropload-refresh">↓下拉刷新</div>',
        domUpdate  : '<div class="dropload-update">↑释放更新</div>',
        domLoad    : '<div class="dropload-load"><span class="loadings"></span>加载中...</div>'
      },
      domDown : {
        domClass   : 'dropload-down',
        domRefresh : '<div class="dropload-refresh">↑上拉加载更多</div>',
        domLoad    : '<div class="dropload-load"><span class="loadings"></span>加载中...</div>',
        domNoData  : '<div class="dropload-noData">暂无更多数据</div>'
      },
      loadUpFn : function(me){
        dlc_request('/api/h5/getUserOrderList',{'openId':getUrlParam('openid'),'page':1,'limit':pagesize}, function(res){
          console.log(res);
          if(res.code == 1){
            var res = res.data.list;
            var str = '';
            for(var i in res){
              str+='<li class="bw plr24 goods_item" onclick="location.href=\'user_details.html?id='+res[i].id+'\'">'+
                '<a class="db">'+
                    '<p class="flex_sb lh70 bdb">'+
                       ' <span class="col9">'+date('Y-m-d H:i:s', res[i].createTime/1000)+'</span>'+
                        '<cite class="'+(res[i].status==0?'color4':res[i].status==1?'color3':'color2')+'">'+(res[i].status==0?'待支付':res[i].status==1?'支付完成':'未出货')+'</cite>'+
					'</p>'+
                    '<div class="ptb30 flex_a bdb">'+
                        '<div><img src="'+res[i].goodsImgUrl+'" class="goods_pic"></div>'+
                        '<div class="flex1 ml20">'+
                            '<p>'+res[i].goodsName+'</p>'+
                            '<p class="flex_sb">'+
                                '<span class="color2">￥'+res[i].price+'</span>'+
                                '<cite class="col9">x'+res[i].num+'</cite>'+
                            '</p>'+
                        '</div>'+
                    '</div>'+
                '</a>'+
                '<div class="flex_sb ptb20">'+
                    '<span class="col9"></span>'+
                    '<cite class="col9">合计:<i class="color3">￥'+res[i].totalPrice+'</i></cite>'+
                '</div>'+
            '</li>';
            }
            setTimeout(function(){
              $('.list').html(str);
              me.resetload();
              page = 1;
              me.unlock();
              me.noData(false);
            },1000);
          }else{
            me.lock();
            me.noData();
            me.resetload();
          }
        });
      },
      loadDownFn : function(me){
        page++;
        dlc_request('/api/h5/getUserOrderList',{'openId':getUrlParam('openid'),'page':page,'limit':pagesize}, function(res){
          console.log(res);
          if(res.code == 1){
            var res = res.data.list;
            var str = '';
            if(res.length>0){
              for(var i in res){
              str+='<li class="bw plr24 goods_item" onclick="location.href=\'user_details.html?id='+res[i].id+'\'">'+
                '<a class="db">'+
                    '<p class="flex_sb lh70 bdb">'+
                       ' <span class="col9">'+date('Y-m-d H:i:s', res[i].createTime/1000)+'</span>'+
                        '<cite class="'+(res[i].status==0?'color4':res[i].status==1?'color3':'color2')+'">'+(res[i].status==0?'待支付':res[i].status==1?'支付完成':'未出货')+'</cite>'+
					'</p>'+
                    '<div class="ptb30 flex_a bdb">'+
                        '<div><img src="'+res[i].goodsImgUrl+'" class="goods_pic"></div>'+
                        '<div class="flex1 ml20">'+
                            '<p>'+res[i].goodsName+'</p>'+
                            '<p class="flex_sb">'+
                                '<span class="color2">￥'+res[i].price+'</span>'+
                                '<cite class="col9">x'+res[i].num+'</cite>'+
                            '</p>'+
                        '</div>'+
                    '</div>'+
                '</a>'+
                '<div class="flex_sb ptb20">'+
                    '<span class="col9"></span>'+
                    '<cite class="col9">合计:<i class="color3">￥'+res[i].totalPrice+'</i></cite>'+
                '</div>'+
            '</li>';
            }
            }else{
              me.lock();
              me.noData();
            }
            // 为了测试，延迟1秒加载
            setTimeout(function(){
              $('.list').append(str);
              me.resetload();
            },1000);
          }else{
            me.lock();
            me.noData();
            me.resetload();
          }
        });
      },
      threshold : 50
    });
  });
  
  
  

</script>






















